<?
$r = "../";
require_once($r."_engine/header_nocache.php");
require_once($r."_engine/c_table_editor_news.php");

$title = "Edit News";
include "_header.php";


if (@$todo == "add") 
{
	$news = new CNews();
	$news->InitNew();
	$data = $news->data;
}
else 
{
	$data = $te_news->GetDataForEdit();
	$todo = "update";
}
?>


<form action="news_process.php" method="post">
<input type="Hidden" name="todo" value="<?=@$todo?>">
<input type="Hidden" name="id" value="<?=@$data["id"]?>">

<table cellspacing="5" cellpadding="0" style="margin-left: 5;">
<tr>
	<td colspan="2" class="tdH">General</td>
</tr>
<tr>
	<td><span class="text">ID:</span></td>
	<td><span class="textStd"><?=@$data["id"]?></span></td>
</tr>
<tr>
	<td><span class="text">Date & Time:</span></td>
	<td><span class="textStd"><input type="Text" name="f_dt" value="<?=date("Y-m-d H:i:s", @$data["dt"])?>" style="width:230" 
		class="input2" class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'"></span></td>
</tr>
<tr>
	<td></td>
	<td><span class="textStd"><input type="Checkbox" name="f_option_is_archived"
		<? html_radio_value("1", @$data["option_is_archived"]); ?>>
		Is archived</td>
</tr>
<tr>
	<td></td>
	<td><span class="textStd"><input type="Checkbox" name="f_option_show_on_fp"
		<? html_radio_value("1", @$data["option_show_on_fp"]); ?>>
		Show on FP</td>
</tr>
<tr>
	<td><span class="text">Title on FP:</span></td>
	<td><span class="textStd"><input type="Text" name="f_title_fp" value="<?=htmlspecialchars(@$data["title_fp"])?>" style="width:230" 
		class="input2" class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'"></span></td>
</tr>
<tr>
	<td><span class="text">Title:</span></td>
	<td><span class="textStd"><input type="Text" name="f_title" value="<?=htmlspecialchars(@$data["title"])?>" style="width:230" 
		class="input2" class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'"></span></td>
</tr>
<tr>
	<td colspan="2" valign="top">
		<span class="textStd"><textarea rows="15" name="f_text"
			style="width: 500;" class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'"
			><?=htmlspecialchars(@$data["text"])?></textarea></td>
</tr>



<tr><td colspan="2">&nbsp;</td></tr>
<tr>
	<td colspan="2" align="right"><span class="textStd">
		<input type="Submit" value="Save" style="width: 150;" class="button2" onMouseOver="this.className='button2_act'" onMouseOut="this.className='button2'">
	</td>
</tr>
</table>
</form>


<?
include "_footer.php";
?>
